'use strict';

var dataPushController = require('../controllers/DataPush.server.controller');
var dataPushAPIController = require('../API/DataPushAPI.server.controller');
var dataDeleteController = require('../API/DataDeleteAPI.server.controller');

module.exports = function(app) {

    app.route('/api/DataPush/getERPSysParamValues').post(dataPushController.getERPSysParamValues);

    app.route('/api/barcodeInfo/getWarehouseList').post(dataPushController.getWarehouseList);

    app.route('/api/barcodeInfo/getBinList').post(dataPushController.getBinList);

    //增加数据同步API -lwd
    app.route('/api/DataPush/EntityDataPush').post(dataPushAPIController.createEntityDataPush);
    app.route('/api/DataPush/EntityDataDelete').post(dataDeleteController.deleteEntity);

    //跨域设置
    //    app.all('*',function (req, res, next) {
    //    	if(req.method == "OPTIONS"){
    // 	    res.header('Access-Control-Allow-Origin', '*');
    // 		res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Accept, X-Requested-With');
    // 		res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
    // 	}
    //     next();
    // });
};